package com.funong.matrix.biz.base.dao;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.funong.matrix.biz.base.entity.SysMsgBusinessTemplateEntity;
import com.funong.matrix.biz.base.mapper.SysMsgBusinessTemplateMapper;
import com.funong.matrix.core.base.Dao;
import com.funong.matrix.core.base.FunongBaseDao;
import com.funong.matrix.core.enums.IsDeletedEnum;
import com.funong.matrix.core.enums.StatusEnum;
import org.aspectj.lang.annotation.Aspect;

import java.util.List;

/**
 * @author : NaNa
 * @since : 2023-05-19 16:40
 **/
@Aspect
@Dao
public class SysMsgBusinessTemplateDao extends FunongBaseDao<SysMsgBusinessTemplateMapper, SysMsgBusinessTemplateEntity> {

    public List<SysMsgBusinessTemplateEntity> findTempByCode(String businessCode) {
        List<SysMsgBusinessTemplateEntity> list = this.list(Wrappers.<SysMsgBusinessTemplateEntity>lambdaQuery()
                .eq(SysMsgBusinessTemplateEntity::getBusinessCode, businessCode)
                .eq(SysMsgBusinessTemplateEntity::getStatus, StatusEnum.ENABLE.getValue())
                .eq(SysMsgBusinessTemplateEntity::getBusinessCode, IsDeletedEnum.NOT_DELETED.getValue())
        );
        return list;
    }
}
